/**
 * @param {string} s
 * @return {boolean}
 */
var isPalindrome = function (s) {
    s1 = s.replace(/[\W|_]/g, "").toLocaleLowerCase();
    console.log(s1);
    const len = s1.length;
    for (let i = 0; i < len / 2; i++) {
        if (s1[i] !== s1[len - i - 1]) {
            return false;
        }
    }
    return true;
};
isPalindrome("race a car");